package code.google.jcontainer.test.intercept;

import code.google.jcontainer.AbstractContainer;
import code.google.jcontainer.ContainerFactory;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
 * @create 2009-12-21 16:13:37
 */
public class InterceptTestCase {

    private static AbstractContainer simpleContainer;

    @BeforeClass
    public static void setup(){
        // get my simple container by name
        simpleContainer = ContainerFactory.scanPackages("code.google.jcontainer.test").getContainer("SimpleContainer");
    }

    @Test
    public void testIntercept(){
        InterceptableTestBean interceptableTestBean = (InterceptableTestBean)simpleContainer.getComponent("InterceptableTestBean");
        System.out.println("echo 'Hello', get " + interceptableTestBean.echo("Hello"));
    }

}